Skip to content

Make --config the primary flag for local server start#258

Open
sdairs wants to merge 2 commits into
mainfrom
issue-252-config-alias
Open

Make --config the primary flag for local server start#258
sdairs wants to merge 2 commits into
mainfrom
issue-252-config-alias

Conversation

@sdairs

@sdairs sdairs commented Jun 16, 2026

Copy link
Copy Markdown
Collaborator

Closes #252.

What

clickhousectl local server start now takes --config <NAME> as the primary flag. The old --config-file keeps working as a hidden backward-compatible alias (still parses, but no longer shown in --help).

Changes

  • local/cli.rs — flag is now #[arg(long = "config", alias = "config-file", ...)]; help text + after_help reference --config. Tests: parses_server_start_config (new primary) and parses_server_start_config_file_legacy_alias (alias still parses).
  • local/mod.rs — trailing-arg passthrough guard now rejects --config (the prefix also covers --config-file); updated comment + error message.
  • local/output.rsserver configs hints now say --config; updated test assertion.
  • local/config.rs — CLI-flag references in module/fn docs updated to --config.
  • README.md — custom-config docs updated to --config, with a note that --config-file remains a legacy alias.

Testing

  • cargo build, cargo test -p clickhousectl, cargo clippy --all-targets all pass.
  • Manually verified: --config appears in --help, --config-file does not; passthrough rejection fires for both.

🤖 Generated with Claude Code


Note

Low Risk
CLI surface and documentation only; behavior for named configs is unchanged aside from stricter rejection of --config in trailing server args.

Overview
clickhousectl local server start now documents and surfaces --config <NAME> as the way to apply a named overlay from ~/.clickhouse/configs/. --config-file remains a clap alias so existing scripts keep working.

Help text, README custom-config examples, server configs hints, and module comments are aligned on --config. Trailing-arg validation now rejects --config (prefix match also covers --config-file) so raw ClickHouse config paths cannot bypass managed overlay handling. Tests cover parsing --config and the legacy alias.

Reviewed by Cursor Bugbot for commit 4d355e4. Bugbot is set up for automated code reviews on this repo. Configure here.

Rename the `server start` config flag to `--config`, keeping `--config-file`
working as a hidden backward-compatible alias. Updates help text, after_help,
output hints, module docs, and README accordingly, and extends the trailing-arg
passthrough guard to reject `--config` as well (the `--config` prefix also
covers `--config-file`).

Closes #252

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@sdairs sdairs requested a review from iskakaushik as a code owner June 16, 2026 09:42

@iskakaushik iskakaushik left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

# Conflicts:
#	crates/clickhousectl/src/local/cli.rs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

support --config as alias of --config-file

2 participants